package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.StarMonthlySettlementDetail;
import com.chenfan.mcn.model.dto.StarMonthlySettlementSearchDTO;
import com.chenfan.mcn.model.vo.StarMonthlyOneSettlementExportVO;
import com.chenfan.mcn.model.dto.StarMonthlySettlementDetailQueryDTO;
import com.chenfan.mcn.model.dto.StarMonthlySettlementExcutionOrderAddDTO;
import com.chenfan.mcn.model.dto.StarMonthlySettlementExcutionOrderQueryDTO;
import com.chenfan.mcn.model.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 红人月度结算单明细表 Mapper 接口
 * </p>
 *
 * @author wulg
 * @since 2022-01-13
 */
public interface StarMonthlySettlementDetailMapper extends EnhancedBaseMapper<StarMonthlySettlementDetail> {

    /**
     * 获取打款金额汇总信息
     * @param id
     * @return
     */
    StarMonthlySettlementPaySummaryVO getPaySummary(@Param("id") Long id);

    /**
     * 导出子结算单 新模板
     * @param id 子结算单ID
     * @param subCode 子结算单号
     * @return
     */
    List<StatementPerformListExportVO> exportSubSettlementList(@Param("id") Long id,@Param("subCode") String subCode);

    /**
     *  导出结算单明细
     * @param dto
     * @return
     */
    List<StarMonthlySettlementDetailExportVO> exportSettlementDetail(@Param("dto") StarMonthlySettlementDetailQueryDTO dto);

    /**
     *  导出结算单明细列表
     * @param dto
     * @return
     */
    List<StatementPerformListExportVO> exportSettlementDetailList(@Param("dto") StarMonthlySettlementDetailQueryDTO dto);


    /**
     * 导出单个单据
     * @param id
     * @return
     */
    List<StarMonthlyOneSettlementExportVO> exportOneStatement(@Param("id") Long id);

    /**
     * 导出单据列表
     * @param dto
     * @return
     */
    List<StatementListExportVO> exportStatementList(@Param("dto") StarMonthlySettlementSearchDTO dto);

    /**
     *  导出单据平台列表
     * @param dto
     * @return
     */
    List<StatementPerformListExportVO> exportStatementPerformList(@Param("dto") StarMonthlySettlementSearchDTO dto);

    /**
     * 分页查询单据明细
     * @param page
     * @param dto
     * @return
     */
    Page<StarMonthlySettlementDetailListVO> getDetailPage(Page<StarMonthlySettlementDetailListVO> page, @Param("dto") StarMonthlySettlementDetailQueryDTO dto);

    /**
     *  红人月度结算单-分页查询执行单
     * @param page
     * @param dto
     * @return
     */
    Page<StarMonthlySettlementExcutionOrderVO> getExcutionOrders(Page<StarMonthlySettlementDetailListVO> page, @Param("dto") StarMonthlySettlementExcutionOrderQueryDTO dto);

    /**
     *  获取结算打印单信息
     * @param subSettlementCode
     * @return
     */
    StarMonthlySettlementPrintVO getStarMonthlyPrintStar(@Param("subSettlementCode") String subSettlementCode);

    /**
     * 获取财务结算信息
     * @param chargeSourceCode
     * @return
     */
    FinanceSettleInfoVO getFinanceSettleInfo(@Param("chargeSourceCode") String chargeSourceCode);

    /**
     *  获取子结算单关联的执行单数据
     * @param subSettlementCode
     * @return
     */
    List<StarMonthlySettlementExecuteDataVO> getExecuteDataList(@Param("subSettlementCode") String subSettlementCode);

    /**
     *  获取打款金额汇总
     * @param subSettlementCode
     * @return
     */
    StarMonthlySettlementPrintPaySummaryVO getExecuteDataPaySummary(@Param("subSettlementCode") String subSettlementCode);

    /**
     * 查询要添加的执行单
     * @param dto
     * @return
     */
    List<StarMonthlySettlementExcutionOrderAddVO> getAddExcutionOrders(@Param("dto") StarMonthlySettlementExcutionOrderAddDTO dto);

    /**
     * 根据红人id获取红人联系人手机号
     * @param starId
     * @return
     */
    String selectStarLiaisonPhoneByStartId(@Param("starId") Long starId);
}
